﻿#region 导入名称空间

using System;
using System.Collections.Generic;
using Autofac;
using Topshelf.Builders;
using Topshelf.Configurators;
using Topshelf.HostConfigurators;

#endregion

namespace LightWork.Topshelf.Autofac
{
    public class AutofacHostBuilderConfigurator : HostBuilderConfigurator
    {
        #region Constructors and Destructors

        public AutofacHostBuilderConfigurator(ILifetimeScope lifetimeScope)
        {
            if (lifetimeScope == null)
                throw new ArgumentNullException("lifetimeScope");

            LifetimeScope = lifetimeScope;
        }

        #endregion

        #region Public Properties

        public static ILifetimeScope LifetimeScope { get; private set; }

        #endregion

        #region Static Fields

        #endregion

        #region Public Methods and Operators

        public HostBuilder Configure(HostBuilder builder)
        {
            return builder;
        }

        public IEnumerable<ValidateResult> Validate()
        {
            yield break;
        }

        #endregion
    }
}